<template>
  <div class="header">
    <div class="box">
      <button
        @click="Myclick(0)"
        :class="['password', index == 0 ? 'active' : '']"
      >
        密码
      </button>
      <button @click="Myclick(1)" :class="['mail', index == 1 ? 'active' : '']">
        短信
      </button>
    </div>
    <div class="text">
      <div class="content" v-if="this.index == 0">
        <password></password>
      </div>
      <div class="content" v-else>
        <mail></mail>
      </div>
    </div>
  </div>
</template>


<style lang="less" scoped>
.header {
  width: 1200px;
  margin: 0 auto;
  .box {
    margin: 0 auto;
    margin-left: 400px;
    margin-top: 100px;
    .password {
      width: 150px;
      height: 40px;
      margin-right: 100px;
      color: #000000;
      background-color: #fff;
      border: 1px solid #e3e7ed;
    }
    .mail {
      width: 150px;
      height: 40px;
      color: #000000;
      background-color: #fff;
      border: 1px solid #e3e7ed;
    }
    .active {
      color: #1989fa;
      background-color: #fff;
      border: 1px solid #1989fa;
    }
  }
}
</style>


<script>
import Password from "../components/Password.vue";
import Mail from "../components/Mail.vue"
export default {
  name: "Primarylogin",
  components: {
    Password,
    Mail
  },
  data() {
    return {
      index: 0,
    };
  },
  methods: {
    Myclick(v1) {
      console.log(v1);
      this.index = v1;
    },
  },
};
</script>